package com.xujl.mvcbind.bean;

import java.util.Objects;

public class OneMultiEntity implements ProviderMultiEntity {
    private String title;
    private String subTitle;

    public OneMultiEntity (String title, String subTitle) {
        this.title = title;
        this.subTitle = subTitle;
    }

    public String getTitle () {
        return title;
    }

    public void setTitle (String title) {
        this.title = title;
    }

    public String getSubTitle () {
        return subTitle;
    }

    public void setSubTitle (String subTitle) {
        this.subTitle = subTitle;
    }

    @Override
    public int getProviderType () {
        return TYPE_ONE;
    }

    @Override
    public boolean equals (Object o) {
        if (this == o) return true;
        if (!(o instanceof OneMultiEntity)) return false;
        OneMultiEntity that = (OneMultiEntity) o;
        return getTitle().equals(that.getTitle()) &&
                getSubTitle().equals(that.getSubTitle());
    }

    @Override
    public int hashCode () {
        return Objects.hash(getTitle(), getSubTitle());
    }
}
